package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysTopTitleMapper;
import com.ruoyi.system.domain.SysTopTitle;
import com.ruoyi.system.service.ISysTopTitleService;
import com.ruoyi.common.core.text.Convert;

/**
 * 顶部选项卡Service业务层处理
 * 
 * @author kuaidou
 * @date 2021-08-27
 */
@Service
public class SysTopTitleServiceImpl implements ISysTopTitleService 
{
    @Autowired
    private SysTopTitleMapper sysTopTitleMapper;

    /**
     * 查询顶部选项卡
     * 
     * @param id 顶部选项卡主键
     * @return 顶部选项卡
     */
    @Override
    public SysTopTitle selectSysTopTitleById(Long id)
    {
        return sysTopTitleMapper.selectSysTopTitleById(id);
    }

    /**
     * 查询顶部选项卡列表
     * 
     * @param sysTopTitle 顶部选项卡
     * @return 顶部选项卡
     */
    @Override
    public List<SysTopTitle> selectSysTopTitleList(SysTopTitle sysTopTitle)
    {
        return sysTopTitleMapper.selectSysTopTitleList(sysTopTitle);
    }

    /**
     * 新增顶部选项卡
     * 
     * @param sysTopTitle 顶部选项卡
     * @return 结果
     */
    @Override
    public int insertSysTopTitle(SysTopTitle sysTopTitle)
    {
        sysTopTitle.setCreateTime(DateUtils.getNowDate());
        return sysTopTitleMapper.insertSysTopTitle(sysTopTitle);
    }

    /**
     * 修改顶部选项卡
     * 
     * @param sysTopTitle 顶部选项卡
     * @return 结果
     */
    @Override
    public int updateSysTopTitle(SysTopTitle sysTopTitle)
    {
        sysTopTitle.setUpdateTime(DateUtils.getNowDate());
        return sysTopTitleMapper.updateSysTopTitle(sysTopTitle);
    }

    /**
     * 批量删除顶部选项卡
     * 
     * @param ids 需要删除的顶部选项卡主键
     * @return 结果
     */
    @Override
    public int deleteSysTopTitleByIds(String ids)
    {
        return sysTopTitleMapper.deleteSysTopTitleByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除顶部选项卡信息
     * 
     * @param id 顶部选项卡主键
     * @return 结果
     */
    @Override
    public int deleteSysTopTitleById(Long id)
    {
        return sysTopTitleMapper.deleteSysTopTitleById(id);
    }
}
